read_file = open("idschoolname.txt", "r",encoding='utf-8')
write_file = open("2019urls.txt", "a+")

try:
    text_line = None
    schoolList=[]
    provinceList=[61,11,12,13,14,15,21,22,23,31,32,33,34,35,36,37,41,42,43,44,45,46,50,51,52,53,62,63,64,65]
    typeList=[7,8,14,36,37,51,52,1570,86,1137]
    while True:
        text_line = read_file.readline()
        # print(text_line)
        if text_line:
            schoolList.append(text_line.split(',')[1].replace("\n",""))
        else:
            break
    for year in range(2019,2020):
        for id in schoolList:
            for provinceId in provinceList:
                for type in range(1,4):
                    for type1 in typeList:
                        url="https://static-data.eol.cn/www/2.0/schoolplanindex/"+str(year)+"/"+str(id)+"/"+str(provinceId)+"/"+str(type)+"/"+str(type1)+"/"+"1.json"
                        write_file.write(url+"\n")





finally:
    write_file.close()
    read_file.close()

